home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / obsolete / listwise.pro < prev    next >
Text File  |  1997-07-08  |  942b  |  37 lines

  1. ; $Id: listwise.pro,v 1.2 1997/01/15 04:02:19 ali Exp $
  2. ;
  3. ;  Copyright (c) 1991-1997, Research Systems Inc.  All rights
  4. ;  reserved. Unauthorized reproduction prohibited.
  5.  
  6.  
  7.  Function ListWise,Data,MV,RowNum, Rows,here
  8.  
  9.  ;ListWise returns an array identical to Data modulo the rows containing
  10.  ; the missing data value, MV. Data must be a 2D array. Here is a list of
  11.  ; excluded rows. Rows is an array of excluded rows.
  12.  
  13.  SD=Size(Data)
  14.  C=SD(1)
  15.  R= SD(2)
  16.  
  17.  
  18.  here=[0]
  19.  RowNum = [0]
  20.  Row = [0]
  21.  for i=0,R-1 DO BEGIN
  22.      V=Where(Data(*,i) EQ MV,count)
  23.      if( count EQ 0) THEN  here=[here,i] else BEGIN
  24.        RowNum = [RowNUM,i]
  25.        Row   = [Row,Data(*,i)]
  26.      ENDELSE
  27.  ENDFOR
  28.  if n_elements(here) le 1 THEN  return, -1 
  29.  here = here(1:*) 
  30.  if (N_Elements(Row)) eq 1 then $ ;no missing values 
  31.    return, Data
  32.  RowNum = RowNum(1:*)
  33.  Rows   = Fltarr(C,N_Elements(RowNum))
  34.  Row    = Row(1:*)
  35.  Rows(0:*,0:*)  = row 
  36.  return,Data(*,here)
  37.  END